Page({
  data: {
    goods: [
      {
        img: '/pages/toy/ppmt.png',
        title: '泡泡玛特',
        desc: '出坑，可小刀',
        price: '999'
      },
      {
        img: 'https://images.unsplash.com/photo-1464983953574-0892a716854b?auto=format&fit=crop&w=400&q=80',
        title: '魔童哪吒',
        desc: '手机支架，没怎么用过',
        price: '99'
      },
      {
        img: 'https://images.unsplash.com/photo-1502082553048-f009c37129b9?auto=format&fit=crop&w=400&q=80',
        title: '三丽鸥-库洛米',
        desc: '女儿不喜欢了，出闲置',
        price: '58.8'
      },
      {
        img: 'https://images.unsplash.com/photo-1519125323398-675f0ddb6308?auto=format&fit=crop&w=400&q=80',
        title: '棉花娃娃',
        desc: '自己制作，喜欢可拍',
        price: '99.9元'
      }
    ]
  },
  onGoodsTap(e) {
    const idx = e.currentTarget.dataset.index;
    const item = this.data.goods[idx];
    if (item.title.indexOf('棉花娃娃') !== -1) {
      wx.navigateTo({
        url: '/pages/toy/doll'
      })
    }
  },
  goMine() {
    wx.redirectTo({
      url: '/pages/mine/index'
    })
  }
}) 